From 48f1b89eae8d67663f841865c8eaf1efe08b82a4 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 21 Oct 2009 12:29:03 -0500 Subject: [PATCH] bgo#563010 - Fix clearing the selection in GtkFileChooserButton Previously the filename would get re-set on the button if one cleared the selection, as an async cancellable was not getting canceled in that case. Signed-off-by: Federico Mena Quintero --- gtk/gtkfilechooserbutton.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c index 4319bb0298..70b0b4f268 100644 --- a/gtk/gtkfilechooserbutton.c +++ b/gtk/gtkfilechooserbutton.c @@ -2302,6 +2302,12 @@ update_label_and_image (GtkFileChooserButton *button) label_text = NULL; pixbuf = NULL; + if (priv->update_button_cancellable) + { + g_cancellable_cancel (priv->update_button_cancellable); + priv->update_button_cancellable = NULL; + } + if (files && files->data) { GFile *file; @@ -2333,12 +2339,6 @@ update_label_and_image (GtkFileChooserButton *button) goto out; } - if (priv->update_button_cancellable) - { - g_cancellable_cancel (priv->update_button_cancellable); - priv->update_button_cancellable = NULL; - } - if (g_file_is_native (file)) { priv->update_button_cancellable = -- 2.30.2